package com.wolf.etl.core.rule.check;

import com.wolf.util.StringUtils;
import com.wolf.vo.BaseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author sdyang
 * @date 2019/10/21 15:11
 **/
@Component("cHECK_IS_NOT_NULL")
public class CHECK_IS_NOT_NULL extends AbstractCheckRule {

    private static Logger logger = LoggerFactory.getLogger(CHECK_IS_NOT_NULL.class);

    private static final String logger_prefix = "wolf-etl#com.wolf.etl.core.rule.check#CHECK_IS_NULL";

    @Override
    public BaseResult check(String cxt, String value) {

        BaseResult result = BaseResult.getSuccess();
        if (StringUtils.isNotEmpty(value)) {
            return result;
        }
        result.setSucc(false);
        result.setMessage("字段值为空");
        return result;
    }
}
